#!/bin/bash
#创建ui工程目录

source /etc/profile
. $BEETLE_SHELL_PATH/error.sh


projectName=$1
git_url=$2

if [ ! ${projectName} ]
then
    error_exit "参数存在空值projectName"
fi

if [ ! ${git_url} ]
then
    error_exit "参数存在空值git_url"
fi


mkdir -p /usr/local/beetle/config/${projectName} || error_exit "创建文件夹/usr/local/beetle/config/${projectName}失败"
mkdir -p /usr/local/nginx/${projectName} || error_exit "创建文件夹/usr/local/nginx/${projectName}失败"
mkdir -p /usr/beetle/appbak/${projectName} || error_exit "创建文件夹/usr/beetle/appbak/${projectName}失败"


cd /usr/local/beetle/code || error_exit "进入文件夹/usr/local/beetle/code失败"
if [ ! -e ${projectName} ]
then
	git clone ${git_url} ${projectName} || error_exit
fi

